/**
 * 《跳舞的线》位置代码生成定位点
 */
const levelData = {
  songName: '春天_爱给网_aigei_com.mp3',
  speed: 10,
  totalDuration: 89.914535,
  path: [
    {
      time: '00:00.300',
      timeInSeconds: 0.300742,
      percentage: 0.3344753993333781,
      position: {
        x: 0,
        y: 0,
        z: 0,
      },
      direction: '+Z',
      tag: '1',
    },
    {
      time: '00:00.991',
      timeInSeconds: 0.991999,
      percentage: 1.1032687874101779,
      position: {
        x: 0,
        y: 0,
        z: 6.9125700000000005,
      },
      direction: '+X',
      tag: '3',
    },
  ],
};

for (const path of levelData.path) {
  /**
   * @type {voxelId}
   * 方块ID
   */
  let voxelId = 0;
  switch (path.tag) {
    case '1':
      voxelId = 23;
      break;
    case '3':
      voxelId = 321;
      break;
    default:
  }
  voxels.setVoxelId(path.position.x, path.position.y, path.position.z, voxelId);
}
